package com.application.lucky.activity.me;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.application.lucky.R;
import com.application.lucky.activity.KeFuActivity;
import com.application.lucky.activity.PbChatActivity;
import com.application.lucky.config.Config;
import com.application.lucky.widget.TitlebarView;
import com.application.mylibrary.base.BaseActivity;
import com.qunar.im.base.common.ConversitionType;

public class RechargeTypeActivity extends BaseActivity {

    private TitlebarView mTitleBar;
    private LinearLayout mLlWx;
    private LinearLayout mLlZfb;
    private LinearLayout mLlGf;
    private TextView kefu;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initView();
    }

    @Override
    public void beforeInit() {

    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_recharge_type;
    }

    private void initView() {
        mTitleBar = (TitlebarView) findViewById(R.id.title_bar);
        mLlWx = (LinearLayout) findViewById(R.id.ll_wx);
        mLlZfb = (LinearLayout) findViewById(R.id.ll_zfb);
        mLlGf = (LinearLayout) findViewById(R.id.ll_gf);
        kefu = (TextView) findViewById(R.id.tv_recharge_kefu);

        mTitleBar.setOnViewClick(new TitlebarView.onViewClick() {
            @Override
            public void leftClick() {
                finishAnim();
            }

            @Override
            public void rightClick() {

            }
        });
        mLlWx.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(RechargeTypeActivity.this, NewRechargeActivity.class);
                intent.putExtra("type", 0);
                startActivityAnim(intent);
            }
        });
        mLlZfb.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(RechargeTypeActivity.this, NewRechargeActivity.class);
                intent.putExtra("type", 1);
                startActivityAnim(intent);
            }
        });
        mLlGf.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(RechargeTypeActivity.this, NewRechargeActivity.class);
                intent.putExtra("type", 2);
                startActivityAnim(intent);
            }
        });
        kefu.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(RechargeTypeActivity.this, PbChatActivity.class);
                intent.putExtra(PbChatActivity.KEY_JID, Config.IMIdUtils.getIMUid(Config.KEFU_ID));
                intent.putExtra(PbChatActivity.KEY_CHAT_TYPE, String.valueOf(ConversitionType.MSG_TYPE_CHAT));
                intent.putExtra(PbChatActivity.KEY_IS_CHATROOM, false);
                startActivity(intent);
//                startActivityAnim(new Intent(RechargeTypeActivity.this, KeFuActivity.class));
            }
        });
    }
}
